﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities.Auditing;
using Hangfire.Annotations;
using Hicap.AuthorizationServer.Core.Models.Other;

namespace Hicap.AuthorizationServer.Core.Models
{
    public class Role : FullAuditedEntity
    {
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 角色id
        /// </summary>
        [Required]
        [StringLength(EntityLengthConst.ShortCode)]
        public string RoleCode { get; set; }

        /// <summary>
        /// 角色名
        /// </summary>
        [Required]
        [StringLength(EntityLengthConst.ShortName)]
        public string RoleName { get; set; }

        [ForeignKey("Role")]
        [CanBeNull]
        public int? ParentId { get; set; }

        public virtual Role Parent { get; set; }
    }
}